﻿@using AW.Helper
@model IEnumerable<ListIISApps.Models.ServerManagerVM>
<table>
    <tr>
        <th>
            Path
        </th>
        <th>
            PhysicalPath
        </th>
        <th>
            AppSetting
        </th>
        <th>
            Version
        </th>
        <th>
            ConnectionString
        </th>
        <th>
            AuthenticationMode
        </th>
        <th>
        </th>
    </tr>
    @*@foreach (var item in Model.Where(m => !GeneralHelper.IsNullOrEmpty(m.AppSettings)).OrderByDescending(m => m.AppSettings.OfType<Object>().FirstOrDefault()))*@
    @foreach (var item in Model)
    {
        <tr>
            <td>
                <a href="@Html.DisplayFor(modelItem => item.Application.Path)" target="_blank">@Html.DisplayFor(modelItem => item.Application.Path)</a>
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.PhysicalPath)
            </td>
            <td>
                @{
                    if (!item.AppSettings.IsNullOrEmpty())
                    {
                        @item.AppSettings[0]
                    }
                }
            </td>
            <td>
                @{
                    if (!item.AssembliesInfo.IsNullOrEmpty())
                    {
                        @item.AssembliesInfo.First().InformationalVersion
                    }
                }
            </td>
            <td>
                @{
                    if (!item.ConnectionStrings.IsNullOrEmpty())
                    {
                        @item.ConnectionStrings.First().ConnectionString
                    }
                }
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.AuthenticationMode)
            </td>
            <td>
                @Html.ActionLink("Details", "Details", new {path = item.Application.Path})
            </td>
        </tr>
    }
</table>